#ifndef led_h
#define led_h

#include <Arduino.h>
#include "Pins.h"

// 初始化led，闪烁3次
void setup_led()
{
    
    for (int i = 0; i < 3; i++)
    {
        digitalWrite(LED_PIN, HIGH);
        delay(200);
        digitalWrite(LED_PIN, LOW);
        delay(200);
    }
}
// 正常工作呼吸灯，报错常亮
void led_task(void *pvParameter)
{
    for (;;)
    {
        for (int brightness = 0; brightness <= 255; brightness += 2)
        {
            analogWrite(LED_PIN, brightness);
            delay(10);
        }
        for (int brightness = 255; brightness >= 0; brightness -= 2)
        {
            analogWrite(LED_PIN, brightness);
            delay(10);
        }
    }
}

#endif